Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(expect): normalize whitespace to expect().toHaveValue() #33909

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pengooseDev
Copy link
Contributor

@pengooseDev pengooseDev commented Dec 9, 2024

Closes #23037

  • add normalized target for HTML entities in normalizeWhiteSpace.

This comment has been minimized.

@pengooseDev pengooseDev marked this pull request as draft December 10, 2024 01:44
@pengooseDev pengooseDev force-pushed the feat-toHaveValue-normalize branch from 59c49b9 to 2c903ee Compare December 10, 2024 02:35
@pengooseDev pengooseDev marked this pull request as ready for review December 10, 2024 02:40
Copy link
Contributor

Test results for "tests 1"

1 failed
❌ [playwright-test] › runner.spec.ts:118:5 › should ignore subprocess creation error because of SIGINT @macos-latest-node18-1

1 flaky ⚠️ [playwright-test] › ui-mode-test-watch.spec.ts:145:5 › should watch all @ubuntu-latest-node18-1

37207 passed, 650 skipped
✔️✔️✔️

Merge workflow run.

test('should normalize whitespace', async ({ page }) => {
await page.setContent('<input id=node></input>');
const locator = page.locator('#node');
await locator.fill('foo&nbsp;bar\nbaz');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This results in exactly this text being inserted into the field, which is different from non-breaking whitespaces rendered as whitespace but returned as &nbsp; for the input value. Reading the bug I see that we were not able to find a good repro. Let's start with composing a good test case that fails with the current API before implementing this feature.

image

@pengooseDev pengooseDev marked this pull request as draft December 11, 2024 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] add option to normalize whitespace to expect().toHaveValue()
2 participants